<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        {:build_toolbar('refresh,del')}
                        <div class="dropdown btn-group">
                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
                            </ul>
                        </div>
                        <div class="dropdown btn-group">
                            <a class="btn btn-success btn-more dropdown-toggle" data-toggle="dropdown"><i class="fa fa-qrcode"></i> 追溯码操作</a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link btn-generate" href="javascript:;"><i class="fa fa-plus"></i> 生成追溯码</a></li>
                                <li><a class="btn btn-link btn-download-qr" href="javascript:;"><i class="fa fa-download"></i> 下载二维码</a></li>
                                <li><a class="btn btn-link btn-print-qr" href="javascript:;"><i class="fa fa-print"></i> 打印追溯码</a></li>
                            </ul>
                        </div>
                        <div class="dropdown btn-group">
                            <a class="btn btn-warning btn-more dropdown-toggle" data-toggle="dropdown"><i class="fa fa-history"></i> 历史数据</a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link" href="javascript:;" data-url="{:url('generateAll')}"><i class="fa fa-magic"></i> 批量生成历史追溯码</a></li>
                                <li><a class="btn btn-link btn-clean-qr" href="javascript:;"><i class="fa fa-trash"></i> 清理过期二维码</a></li>
                            </ul>
                        </div>
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-del="{:$auth->check('scanwork/trace_code/del')}" 
                           width="100%">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
// 错误处理
window.addEventListener('error', function(e) {
    console.error('JavaScript错误:', e.error);
});

// 如果RequireJS加载失败，尝试重新加载
if (typeof require === 'undefined') {
    console.warn('RequireJS未加载，尝试重新加载页面');
    setTimeout(function() {
        window.location.reload();
    }, 2000);
}
</script>

